<template>
  <div class="DiaryAreaBox">
    <DiaryAreaHeaderVue v-if="!isdiaryempty"></DiaryAreaHeaderVue>
    <DiaryAreaContentVue v-if="!isdiaryempty"></DiaryAreaContentVue>
    <div class="empty" v-if="isdiaryempty">
      <div class="iconfont icon-qingkong" style="font-size:250px;"></div>
      <div class="emptytitle">你暂时还没有日记记录</div>
    </div>
    <img src="@/assets/书包男.png" class="imgsize">
    <img src="@/assets/书包女.png" class="imgsize two">
     <img src="@/assets/灯笼.png" class="imgsize weizhi">
  </div>
</template>

<script>
import DiaryAreaContentVue from "./DiaryAreaContent.vue";
import DiaryAreaHeaderVue from "./DiaryAreaHeader.vue";
import { mapState} from 'vuex'
export default {
  components: {
    DiaryAreaHeaderVue,
    DiaryAreaContentVue,
  },
  data() {
    return {};
  },
  //监听属性 类似于data概念
  computed: {
    ...mapState(['diaryList']),
    isdiaryempty() {
      return this.diaryList.length == 0;
    },
  },
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {},
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {},
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {},
};
</script>
<style lang='css' scoped>
.DiaryAreaBox {
    width: calc(100% - 323px - 150px);
    height: 100%;
    background: url(@/assets/bj2.jpg) no-repeat bottom right,url(@/assets/bj.png) no-repeat center;
    background-size: 450px 450px;
    position: relative;
}
.imgsize {
    position: absolute;
    width: 150px;
    bottom: 0;
    opacity: .8;
}
.two {
    left: 150px;
}
.weizhi {
    top: 50px;
    left: 50%;
}
.empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  /* margin-top: 25%; */
  width: 100%;
  height: 100%;
  background-color: #fff;
}
.emptytitle {
  font-size: 22px;

}
</style>